package com.example.mapper;

import com.example.entity.SysUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作sys_user相关数据接口
*/
public interface SysUserMapper {

    /**
      * 新增
    */
    int insert(SysUser sys_user);

    /**
      * 删除
    */
    @Delete("delete from sys_user where id = #{id}")
    int deleteById(Integer id);

    /**
      * 修改
    */
    int updateById(SysUser sys_user);

    /**
      * 根据ID查询
    */
    @Select("select * from sys_user where id = #{id}")
    SysUser selectById(Long id);

    /**
      * 查询所有
    */
    List<SysUser> selectAll(SysUser sys_user);

    @Select("select * from sys_user where username = #{username}")
    SysUser selectByUsername(String username);

    List<SysUser> searchUsers(SysUser query, List<Integer> userTypes);
}